package com.jpa.controller;

import com.jpa.entity.sign.User;
import com.jpa.service.SignUserService;
import com.jpa.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping(value = "/user")
public class UserController {

    @Autowired
    UserService userService;

    @Autowired
    SignUserService signUserService;

    @RequestMapping(value = "/sync")
    public String syncUser() {

        userService.syncUser();

        return "SUCCESS";
    }

    @RequestMapping(value = "/params")
    public List<User> paramUser() {
        List<Integer> ids = new ArrayList<>();
        ids.add(1);
        ids.add(2);
        ids.add(3);
        return signUserService.users(ids);
    }

}
